package com.joysuch.wwyt.bp.repository;

import com.joysuch.wwyt.bp.entity.BpEmergencyContingencyType;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;

public interface BpEmergencyContingencyTypeDao extends JpaRepository<BpEmergencyContingencyType, Long>, QuerydslPredicateExecutor<BpEmergencyContingencyType> {

    public Page<BpEmergencyContingencyType> findAll(Specification<BpEmergencyContingencyType> spec, Pageable pageable);

    @Query(value = "select ID from wwyt_bp_emergency_contingency_type where NAME =?1",nativeQuery = true)
    Long findIdByName(String name);


}
